{% extends "layouts/application.html" %}
{% block content %}

<script>
function check_select_one(title_id, cbs_name){
    if(document.getElementById(title_id).checked){
        alert("请选择其中的一条记录");
        return false;
    }
    var row_cbs = document.getElementsByName(cbs_name);
    var checked_number = 0;
    var check_id;
    for(var i = 0; i < row_cbs.length; i++){
        if(row_cbs[i].checked){
			check_id = row_cbs[i].value;
            checked_number += 1;
            if(checked_number > 1){
                alert("请选择其中的一条记录");
                return false;
            }
        }
    }
    if(checked_number == 0){
        alert("请选择其中的一条记录");
        return false;
    }
    location.href='/{%site_root%}/manage/update_role/'+check_id
}

</script>
<div align="center">
  <div class=boxright>
    <div class=bltop2>
      <div align="left">
        <strong>
          当前位置：&nbsp;&nbsp;
          <a href="/{%site_root%}/manage/index/">后台管理</a>&nbsp;&nbsp;
          <img src="/site_media/images/zd_arrow.gif">&nbsp;&nbsp;
          <a href="#">角色管理</a>
        </strong>
      </div>
    </div>
    <div class="rep_left_height">
        <TABLE class=tatop7px cellSpacing=0 cellPadding=4 width="100%" border=0>
          <TBODY>
            <TR>
              <TD class=rep_li_c  ALIGN="left" COLSPAN="10"><STRONG>角色权限分配如下</STRONG></TD>
            </TR>
            <TR style="TEXT-DECORATION: none" onMouseOver="this.style.backgroundColor='#EFF8FF'" onmouseout="this.style.backgroundColor=''">
              <TD class=rep_li_td_bt ALIGN="left">角色名</TD>
              <TD class=rep_li_td_bt ALIGN="left">浏览</TD>
              <TD class=rep_li_td_bt ALIGN="left">搜索</TD>

              <TD class=rep_li_td_bt ALIGN="left">下载</TD>
              <TD class=rep_li_td_bt ALIGN="left">上传</TD>
              <TD class=rep_li_td_bt ALIGN="left">删除</TD>

              <TD class=rep_li_td_bt ALIGN="left">编辑</TD>
              <TD class=rep_li_td_bt ALIGN="left">管理</TD>
            </TR>
            <TR style="TEXT-DECORATION: none" onMouseOver="this.style.backgroundColor='#EFF8FF'" onmouseout="this.style.backgroundColor=''">
              <TD class=rep_li_td_bt ALIGN="left">省公司角色</TD>
              <TD class=rep_li_td_bt ALIGN="left">√</TD>
              <TD class=rep_li_td_bt ALIGN="left">√</TD>
              <TD class=rep_li_td_bt ALIGN="left">√</TD>

              <TD class=rep_li_td_bt ALIGN="left">√</TD>
              <TD class=rep_li_td_bt ALIGN="left">√</TD>

              <TD class=rep_li_td_bt ALIGN="left">√</TD>
              <TD class=rep_li_td_bt ALIGN="left">√</TD>
            </TR>
            <TR style="TEXT-DECORATION: none" onMouseOver="this.style.backgroundColor='#EFF8FF'" onmouseout="this.style.backgroundColor=''">
               <TD class=rep_li_td_bt ALIGN="left">市级用户角色</TD>
              <TD class=rep_li_td_bt ALIGN="left">√</TD>
              <TD class=rep_li_td_bt ALIGN="left">√</TD>
              <TD class=rep_li_td_bt ALIGN="left">√</TD>

              <TD class=rep_li_td_bt ALIGN="left">√</TD>
              <TD class=rep_li_td_bt ALIGN="left">&nbsp;</TD>
              <TD class=rep_li_td_bt ALIGN="left">&nbsp;</TD>
              <TD class=rep_li_td_bt ALIGN="left">&nbsp;</TD>
              <TD class=rep_li_td_bt ALIGN="left">&nbsp;</TD>
            </TR>
            <TR style="TEXT-DECORATION: none" onMouseOver="this.style.backgroundColor='#EFF8FF'" onmouseout="this.style.backgroundColor=''">
          <TD class=rep_li_td_bt ALIGN="left">县级角色 </TD>
              <TD class=rep_li_td_bt ALIGN="left">√</TD>
              <TD class=rep_li_td_bt ALIGN="left">√</TD>
              <TD class=rep_li_td_bt ALIGN="left">√</TD>

              <TD class=rep_li_td_bt ALIGN="left">&nbsp;</TD>
              <TD class=rep_li_td_bt ALIGN="left">&nbsp;</TD>
              <TD class=rep_li_td_bt ALIGN="left">&nbsp;</TD>
              <TD class=rep_li_td_bt ALIGN="left">&nbsp;</TD>
              <TD class=rep_li_td_bt ALIGN="left">&nbsp;</TD>
            </TR>
          </TBODY>
        </TABLE>
          <TABLE class=tatop7px cellSpacing=0 cellPadding=4 width="100%" border=0>
            <TBODY>
              <TR>
                <TD class=rtdw width="4%">
                <INPUT id="chkAll" onclick="title_check('chkAll','chkID[]')"  type=checkbox value=checkbox></TD>
                <TD class=rep_li_c width="40%" ALIGN="left"><STRONG>角色名</STRONG></TD>
              </TR>
              {% if objects %}
              {% for group in objects %}
                <TR id="tr_{{group.id}}" style="TEXT-DECORATION: none" onMouseOver="this.style.backgroundColor='#EFF8FF'" onmouseout="this.style.backgroundColor=''">
                  <TD class=rtdw2>
                  <INPUT onclick="rows_check('chkAll','chkID[]')" type=checkbox value="{{group.id}}" name="chkID[]"></TD>
                  <TD class=rep_li_td_bt ALIGN="left" >
                    &nbsp;{{group.name}}
                  </TD>
                </TR>
              {% endfor %}
              {% endif %}
            </TBODY>
          </TABLE>

          <TABLE cellSpacing=0 cellPadding=4 width="100%" border=0>
            <TBODY>
              <TR vAlign=top>
              <TR vAlign=top ALIGN="left">
                <TD>
                  <INPUT onclick="return check_select_one('chkAll','chkID[]')"
                         name="button" class="bt1" id="edit"  type="submit" value="编辑">
                </TD>
              </TR>
            </TBODY>
          </TABLE>
      </div>
  </div>
</div>
{% endblock %}
